The present invention relates to a program control system which is preferably used for a portable data storage device such as an IC card, a memory card and a non-contact IC card.
Generally, the IC card or memory card includes, in addition to a memory for storing user data, a MPU (main processing unit) for performing several processing operations such as decision of commands from a reader/writer, read/write of user data for the memory in response to a command, communication, check of a code number used for security protection of the user data stored in the memory and cryptography (encryption/decryption), and another memory in cooperation with CPU for storing several programs for executing these processing operations by means of the MPU.
There are two conventional techniques for these programs. The first technique is to use a mask ROM (read only memory) in which all necessary programs are stored. The second technique is to use a mask ROM in which control programs for basic processing operations of the MPU are stored, and a PROM (programmable read-only memory) in which an application program for each user is stored. The PROM includes an EPROM (erasable programmable read-only memory), and an EEPROM (electrically erasable programmable read-only memory where; the user data are also stored in the PROM.
Meanwhile, the storage capacity of the semiconductor memory such as the EPROM and the EEPROM is limited to a certain degree. Therefore, it is desirable for such a semiconductor memory to enlarge a user area for storing user data to a possible maximum limit to increase the possible storage capacity of the user data.
In view of this, the above first technique in which all the programs are stored in a mask ROM is preferable. This technique, however, has disadvantages that the programs cannot be modified so that this technique cannot deal with the requests of changing program(s) for a standard command processing due to development of standardization and the processing for cryptography and communication, of adding a new program, and of replacing a certain program by another program.
On the other hand, the above second technique, in which only the basic program necessary for operating the MPU is stored in the mask ROM and the other processing programs (alternative programs) are stored in the PROM, can deal with the above requests of modification, or addition of a part of the basic program and/or replacement of the whole basic program. This technique, however, also has a disadvantage that the mask ROM, in which only the basic program is stored, has a very low use efficiency and is therefore used in an unsatisfactory manner.